import request from '@/utils/request'

export default {
  // 列表
  query(data) {
    return request({
      url: `/v1/shop/amazon/list`,
      method: 'post',
      data
    })
  },
  // 添加
  create(data) {
    return request({
      url: `/v1/shop/amazon/create`,
      method: 'post',
      data
    })
  },
  // 详情
  detail(params) {
    return request({
      url: `/v1/shop/amazon/detail`,
      method: 'get',
      params
    })
  },
  // 店铺绩效
  performance(params) {
    return request({
      url: `/v1/shop/amazon/performance`,
      method: 'get',
      params
    })
  },
  // 评价分布
  feedbackCount(params) {
    return request({
      url: `/v1/shop/amazon/feedback-count`,
      method: 'get',
      params
    })
  },
  // 评价列表
  feedbackList(params) {
    return request({
      url: `/v1/shop/amazon/feedback-list`,
      method: 'get',
      params
    })
  },
  // 公司详情
  companyDetail(params) {
    return request({
      url: `/v1/company/detail`,
      method: 'get',
      params
    })
  },
  // erp详情
  eprDetail(params) {
    return request({
      url: `/v1/epr/detail`,
      method: 'get',
      params
    })
  },
  // 编辑
  edit(data) {
    return request({
      url: `/v1/shop/amazon/edit`,
      method: 'post',
      data
    })
  },
  // 授权
  auth(data) {
    return request({
      url: `/v1/shop/amazon/auth`,
      method: 'post',
      data
    })
  },
  // 更新授权
  updateAuth(data) {
    return request({
      url: `/v1/shop/amazon/update-auth`,
      method: 'post',
      data
    })
  },
  // 授权链接
  link(params) {
    return request({
      url: `/v1/shop/amazon/link`,
      method: 'get',
      params
    })
  },
  // 广告授权链接
  adLink(params) {
    return request({
      url: `/v1/shop/amazon/ad-link`,
      method: 'get',
      params
    })
  },
  // 广告授权
  adAuth(data) {
    return request({
      url: `/v1/shop/amazon/ad-auth`,
      method: 'post',
      data
    })
  },
  /**
   * amazon店铺编辑时获取手机号下拉列表（判断是否同账号已使用）
   * http://10.20.9.32:40001/project/68/interface/api/14700
   * @returns {AxiosPromise}
   */
  apiPhoneList(params) {
    return request({
      url: `/v1/shop/amazon/phone-list`,
      method: 'get',
      params
    })
  },
  authDetail(params) {
    return request({
      url: `/v1/shop/amazon/auth-detail`,
      method: 'get',
      params
    })
  },
}
